package cn.cvs.service.review;

import cn.cvs.dao.review.ReviewMapper;
import cn.cvs.pojo.Review;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ReviewServiceImpl implements  ReviewService {

    @Resource
    private ReviewMapper reviewMapper;

    @Override
    public List<Review> list(Integer state, Integer pageIndex, Integer pageSize) {
        int pageBane = (pageIndex - 1) * pageSize;
        return reviewMapper.list(state, pageBane, pageSize);
    }

    @Override
    public int count(Integer state) {
        return reviewMapper.count(state);
    }

    @Override
    public int insert(Review review) {
        return reviewMapper.insert(review);
    }

    @Override
    public int updateById(Review review) {
        return reviewMapper.updateById(review);
    }

    @Override
    public int deleteById(Integer id) {
        return reviewMapper.deleteById(id);
    }

    @Override
    public Review selectById(Integer id) {
        return reviewMapper.selectById(id);
    }
}
